Skip to contentSkip to conversation

Change in openvpn[master]: route: Fix overriding return value of add_route3

Openvpn-devel flichtenheld (Code Review) 2 participants 4 messages Jul 28, 2023 – Aug 11, 2023 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1690549401000.I78f92f363fe203af5661c6958b2417ea30f7055c@...2715...

#1 lore raw

flichtenheld has uploaded this change for review. ( http://gerrit.openvpn.net/c/openvpn/+/319?usp=email )

Change subject: route: Fix overriding return value of add_route3
......................................................................

route: Fix overriding return value of add_route3

The return value of add_bypass_routes overwrites the return value of add_route3 instead of combining them.

Coverity: CID 1539180 (#1 of 1): Unused value (UNUSED_VALUE)

Change-Id I78f92f363fe203af5661c6958b2417ea30f7055c

---
M src/openvpn/route.c

1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/19/319/1

src/openvpn/route.c +1 -1
index 90e981e..9212186 100644
@@ -1062,7 +1062,7 @@
 
             /* route DHCP/DNS server traffic through original default gateway */
             ret = add_bypass_routes(&rl->spec.bypass, rl->rgi.gateway.addr, tt, flags,
-                                    &rl->rgi, es, ctx);
+                                    &rl->rgi, es, ctx) && ret;
 
             if (rl->flags & RG_REROUTE_GW)
             {

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/319?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I78f92f363fe203af5661c6958b2417ea30f7055c
Gerrit-Change-Number: 319
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newchange

Acked-by
#2 lore raw

[Openvpn-devel] [PATCH applied] Re: route: Fix overriding return value of add_route3

Yep, Coverity is right :-) - silly code. Fix is in the same style we use elsewhere, so fine.

(The whole error handling on route addition is a bit wonky, but even then we should not forget about errors)

Test compiled on Linux, just to be sure I did not overlook anything.

Your patch has been applied to the master and release/2.6 branch.

commit 8067cc8d1b384d3eb0fc9000992710b02951b266 (master) commit 09e2360a163077001fd33f2f338cf337b45b9ab6 (release/2.6)

Author: Frank Lichtenheld
Date:   Fri Jul 28 14:47:12 2023 +0200
     route: Fix overriding return value of add_route3

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg26900.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#3 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/319?usp=email )

Change subject: route: Fix overriding return value of add_route3
......................................................................

route: Fix overriding return value of add_route3

The return value of add_bypass_routes overwrites the return value of add_route3 instead of combining them.

Coverity: CID 1539180 (#1 of 1): Unused value (UNUSED_VALUE)

Change-Id I78f92f363fe203af5661c6958b2417ea30f7055c

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg26900.html

---
M src/openvpn/route.c

1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/19/319/2

src/openvpn/route.c +1 -1
index 90e981e..9212186 100644
@@ -1062,7 +1062,7 @@
 
             /* route DHCP/DNS server traffic through original default gateway */
             ret = add_bypass_routes(&rl->spec.bypass, rl->rgi.gateway.addr, tt, flags,
-                                    &rl->rgi, es, ctx);
+                                    &rl->rgi, es, ctx) && ret;
 
             if (rl->flags & RG_REROUTE_GW)
             {

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/319?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I78f92f363fe203af5661c6958b2417ea30f7055c
Gerrit-Change-Number: 319
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset

#4 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/319?usp=email )

Change subject: route: Fix overriding return value of add_route3
......................................................................

route: Fix overriding return value of add_route3

The return value of add_bypass_routes overwrites the return value of add_route3 instead of combining them.

Coverity: CID 1539180 (#1 of 1): Unused value (UNUSED_VALUE)

Change-Id I78f92f363fe203af5661c6958b2417ea30f7055c

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg26900.html

---
M src/openvpn/route.c

1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/route.c +1 -1
index 90e981e..9212186 100644
@@ -1062,7 +1062,7 @@
 
             /* route DHCP/DNS server traffic through original default gateway */
             ret = add_bypass_routes(&rl->spec.bypass, rl->rgi.gateway.addr, tt, flags,
-                                    &rl->rgi, es, ctx);
+                                    &rl->rgi, es, ctx) && ret;
 
             if (rl->flags & RG_REROUTE_GW)
             {

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/319?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I78f92f363fe203af5661c6958b2417ea30f7055c
Gerrit-Change-Number: 319
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged